package test;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;

public class Copy {

	public static void main(String[] args) {
		InputStream is=null;
		OutputStream os=null;
		try {
			is=new FileInputStream("resources/work.txt");
			os=new FileOutputStream("resources/work2.txt");
			byte[] bytes=new byte[is.available()];
			is.read(bytes);
			os.write(bytes);
			os.flush();
			System.out.println("复制成功");
		} catch (Exception e) {
			e.printStackTrace();
		}finally {
			try {
				is.close();
				os.close();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

	}

}
